-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Remove infinite snapshot logging #137821
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Remove infinite snapshot logging #137821
Conversation
Modifies the SnapshotShutdownProgressTracker to only log the periodic progress report when there are still snapshots left to process. This removes the existing behaviour where the report will log indefinitely, even once all snapshots are completed or paused. Closes: ES-12794
…ng-stops-when-no-snapshots
| // Simulate starting shutdown -- should reset the completion stats and start logging | ||
| // Register each snapshot as in progress | ||
| for (int i = 0; i < 5; ++i) { | ||
| tracker.incNumberOfShardSnapshotsInProgress(dummyShardId, dummySnapshot); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This mimics production behaviour where snapshots are added to the tracker prior to the node shutting down. If I didn't, when calling tracker.onClusterStateAddShutdown(); the periodic logger would begin and then immediately end since there would be no in-progress snapshots
|
Pinging @elastic/es-distributed-coordination (Team:Distributed Coordination) |
DiannaHohensee
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quite a few nits, but superficial stuff.
Comments are great to have, but they should explain why something is happening, not only say what’s happening. ‘What’ can generally be understood with some effort from reading the code, but ‘why’ is the difficult part for new readers to grasp. I’d use ‘what’ comments for high level what’s happening in a section of code, when there's a series of steps. But having the ‘what’ without a clear ‘why’ is often frustrating for a reader. E.g., “I wrote this thing and this is what it does, but for the life of me I can’t remember why I wrote it to do that thing”, becomes a problem.
server/src/main/java/org/elasticsearch/snapshots/SnapshotShutdownProgressTracker.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/snapshots/SnapshotShutdownProgressTracker.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/snapshots/SnapshotShutdownProgressTracker.java
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/snapshots/SnapshotShutdownProgressTracker.java
Show resolved
Hide resolved
server/src/test/java/org/elasticsearch/snapshots/SnapshotShutdownProgressTrackerTests.java
Outdated
Show resolved
Hide resolved
server/src/test/java/org/elasticsearch/snapshots/SnapshotShutdownProgressTrackerTests.java
Outdated
Show resolved
Hide resolved
server/src/test/java/org/elasticsearch/snapshots/SnapshotShutdownProgressTrackerTests.java
Outdated
Show resolved
Hide resolved
server/src/test/java/org/elasticsearch/snapshots/SnapshotShutdownProgressTrackerTests.java
Outdated
Show resolved
Hide resolved
server/src/test/java/org/elasticsearch/snapshots/SnapshotShutdownProgressTrackerTests.java
Outdated
Show resolved
Hide resolved
server/src/test/java/org/elasticsearch/snapshots/SnapshotShutdownProgressTrackerTests.java
Outdated
Show resolved
Hide resolved
…en-no-snapshots' of https://github.com/joshua-adams-1/elasticsearch into snapshot-logging-improvements-periodic-logging-stops-when-no-snapshots
|
Hey, thank you for reviewing. I've updated in line with the comments, let me know if there's anything else you want me to clarify / improve |
server/src/test/java/org/elasticsearch/snapshots/SnapshotShutdownProgressTrackerTests.java
Outdated
Show resolved
Hide resolved
server/src/test/java/org/elasticsearch/snapshots/SnapshotShutdownProgressTrackerTests.java
Outdated
Show resolved
Hide resolved
server/src/test/java/org/elasticsearch/snapshots/SnapshotShutdownProgressTrackerTests.java
Outdated
Show resolved
Hide resolved
server/src/test/java/org/elasticsearch/snapshots/SnapshotShutdownProgressTrackerTests.java
Outdated
Show resolved
Hide resolved
server/src/test/java/org/elasticsearch/snapshots/SnapshotShutdownProgressTrackerTests.java
Outdated
Show resolved
Hide resolved
server/src/test/java/org/elasticsearch/snapshots/SnapshotShutdownProgressTrackerTests.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/snapshots/SnapshotShutdownProgressTracker.java
Outdated
Show resolved
Hide resolved
…ng-stops-when-no-snapshots
DiannaHohensee
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Modifies the
SnapshotShutdownProgressTrackerto only log the periodic progress report while there are still snapshots left to process. This removes the existing behaviour where the report will log indefinitely, even once all snapshots are completed or paused.Closes: ES-12794